package com.example.boot.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * mybatis-plus
 * @author shkstart
 * @creat 2021-03-31-上午8:27
 */

@Data
@Component
@TableName(value = "user",excludeProperty = {"username","password"})//标注该javabean对应哪张表
public class User {
    //mybatis-plus默认要求所有属性在数据库中都要有相对应的字段
    //@TableField说明这个属性是表里的属性，exist = false说明该属性在表里不存在
//    @TableField(exist = false)
    private String username;
//    @TableField(exist = false)
    private String password;
    //mybatis-plus测试字段
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
    private String email;
}
